package edu.cuit.avatar.map;

import edu.cuit.avatar.collection.Circle;

import java.util.Comparator;
import java.util.TreeMap;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/15 14:40
 */
public class TreeMapTest {
    public static void main(String[] args) {
        var map = new TreeMap<Float, Circle>(Comparator.reverseOrder());//逆序排序
        map.put(20f, new Circle(20));
        map.put(5f, new Circle(5));
        map.put(10f, new Circle(10));
        map.put(25f, new Circle(25));

        for (var entry : map.entrySet())
            System.out.println(entry.getKey() + ":" + entry.getValue());

    }
}
